package com.lineage.data.item_etcitem;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.ServerBasePacket;

public class ItemFireCount extends ItemExecutor {
  private int _type;
  
  private int _type1;
  
  public static ItemExecutor get() {
    return new ItemFireCount();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    if (item == null)
      return; 
    if (pc == null)
      return; 
    if (pc.getQuburcount() >= this._type1) {
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("\\fU爆气值已饱和状态"));
      return;
    } 
    pc.setQuburcount(pc.getQuburcount() + this._type);
    pc.sendPackets((ServerBasePacket)new S_ServerMessage("目前爆气值:" + pc.getQuburcount()));
    pc.getInventory().removeItem(item, 1L);
  }
  
  public void set_set(String[] set) {
    try {
      this._type = Integer.parseInt(set[1]);
    } catch (Exception exception) {}
    try {
      this._type1 = Integer.parseInt(set[2]);
    } catch (Exception exception) {}
  }
}
